<template>
	<view class="bg-FFFFFF  fw-500 f-28"
		style="padding-top: 25rpx;color: #101010;padding-left: 19rpx;padding-right: 20rpx;padding-bottom: 30rpx;border-radius: 10rpx 10rpx 0rpx 0rpx;">
		<view class="border-b-DDDDDD f-34" style="padding-bottom: 25rpx;margin-bottom: 26rpx;">
			手机号：{{data.mobile}}
		</view>
		<view class="" style="color: #646464;">
			订单编号：{{data.order_sn}}
		</view>
		<view class="mt-30 f-28">
			<text>订单金额：</text>
			<text>{{data.total_amount}}</text>
		</view>
		<view class="mt-30">
			<text>商品数量： </text>
			<text>{{data.goods_counts}}</text>
		</view>
		<view class="mt-30">
			<text>客户名称：</text>
			<text>{{data.username}}</text>
		</view>
		<!-- <view class="mt-30">
			<text>核销端： </text>
			<text>订单</text>
		</view> -->
		<view class="mt-30">
			<text>核销人： </text>
			<text>{{data.operation_name}}</text>
		</view>
		<view class="mt-30">
			<text>支付方式：</text>
			<text>{{data.pay_type | pay}}支付</text>
		</view>
		<view class="mt-30">
			<text>核销时间：</text> 
			<text v-if="createtime">{{createtime}}</text>
			<text v-else>{{time | getYMDHMS}}</text>
			<!-- <text>{{time}}</text> -->
		</view>
		<view class="mt-30 flex">
			<view class="">
				核销商品：
			</view>
			<view class="">
				<view class="flex  border-b-DDDDDD" style="padding-bottom: 20rpx;margin-bottom: 20rpx;"
					v-for="(item,index) in order_info" :key="index">
					<view class="bor-r10 mr-10" style="width: 70rpx;height: 70rpx;border: 1px solid #DDDDDD;">
						<image :src="item.goods_image" mode=""></image>
					</view>
					<view class="">
						<view class="">
							<!-- [江中]健胃消食片0.8g*8片 -->
							{{item.goods_title}}
						</view>
						<view class="">
							数量：{{item.goods_num}}
						</view>
					</view>
					<!-- <view class="" style="width: 100%;height: 2rpx;background-color: #DDDDDD;">
					</view> -->
				</view>
			</view>
		</view>
		<view class="mt-10" v-if="data.status==1">
			<x-Indent-button :order_id="data.order_id ? data.order_id  : data.id" />
		</view>
	</view>
</template>

<script>
	var paystate = [{
			id: 'wechat',
			name: '微信支付'
		},
		{
			id: 'alipay',
			name: '支付宝'
		},
		{
			id: 'wallet',
			name: '钱包'
		},
		{
			id: 'score',
			name: '积分'
		}
	];
	export default {
		// order_info核销商品
		// props: ['data', "order_info", {
		// 	time: {
		// 		type: String,
		// 		default: ''
		// 	},
		// 	createtime: {
		// 		type: String,
		// 		default: ''
		// 	}
		// }],
		props: ['data', "order_info","time","createtime"],
		data() {
			return {

			}
		},
		filters: {
			pay(id) {
				const payobj = paystate.find(item => item.id == id);
				return payobj ? payobj.name : null;
			},
			getYMDHMS(timestamp) {
				var numtimestamp = Number(timestamp);
				let time = new Date(numtimestamp)
				let year = time.getFullYear()
				let month = time.getMonth() + 1
				let date = time.getDate()
				let hours = time.getHours()
				let minute = time.getMinutes()
				let second = time.getSeconds()

				if (month < 10) {
					month = '0' + month
				}
				if (date < 10) {
					date = '0' + date
				}
				if (hours < 10) {
					hours = '0' + hours
				}
				if (minute < 10) {
					minute = '0' + minute
				}
				if (second < 10) {
					second = '0' + second
				}
				return year + '-' + month + '-' + date + ' ' + hours + ':' + minute + ':' + second
			}
		},
		methods: {

		}
	}
</script>

<style scoped>
	@import url("@/common/css/fress.css");
	@import url("@/common/css/mycss.css");
</style>
